/**
 * 
 */
package model;

/**
 * @author Bill
 * 
 * The Player class keeps track of health, points and the
 * ManualWeapons owned by the user.
 *
 */
public class Player {
	private float health;
	private float maxHealth;
	private int points;
	private Cargo cargo;
	
	public Player( int points, int health){
		this.points = points;
		this.maxHealth = health;
		this.health = maxHealth;
		
		cargo = new Cargo();
		
	}
	
	public int getPoints() {
		return points;
	}

	public void setPoints(int points) {
		this.points = points;
	}
	
	public void addPoints(int points){
		this.points += points;
	}

	public Player( int health ){
		this.health = health;
	}

	public float getHealth() {
		return health;
	}

	public void setHealth(float health) {
		this.health = health;
		if(this.health > this.maxHealth) this.health = maxHealth;
	}
	
	public float getMaxHealth() {
		return maxHealth;
	}

	public void setMaxHealth(float maxHealth) {
		this.maxHealth = maxHealth;
	}

	public Cargo getCargo() {
		return cargo;
	}

	public void setCargo(Cargo cargo) {
		this.cargo = cargo;
	}
	
	public void damagePlayer( float damage ){
		health = health - damage;
	}
	
	public boolean buyItem( int cost ){
		if( cost > points ){
			return false;
		}
		else{
			points = points - cost;
			return true;
		}
	}
	
	
	
}
